package com.anxinr.service.impl;

import com.anxinr.mapper.TestCaseMapper;
import com.anxinr.pojo.entity.TestCase;
import com.anxinr.service.ITestCaseService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * @author anxinr
 */
@Service
public class ITestCaseServiceImpl extends ServiceImpl<TestCaseMapper,TestCase> implements ITestCaseService {
    @Override
    public Page<TestCase> queryUsers(TestCase testCase) {
        Page<TestCase> page = new Page<>(testCase.getPage(), testCase.getSize());
        LambdaQueryWrapper<TestCase> wrapper = new LambdaQueryWrapper<>();
        wrapper.like(StringUtils.isNotBlank(testCase.getCname()),TestCase::getCname,testCase.getCname());
        return this.page(page,wrapper);
    }
}
